const router = require('../router');
const jwt = require('jsonwebtoken');

const expireTime = 60 * 60;

router.post('/login', async function(req, res) {
    const { uname, upwd } = req.body;
    const token = jwt.sign({uname,upwd},'auth',{ expiresIn: expireTime })
    res.json({
        code: "0",
        success: true,
        data: {
            token
        },
        msg: "成功"
    })
})

module.exports = router;